package com.qyhl.module_home.city.bestone;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.qyhl.module_home.R;
import com.qyhl.webtv.commonlib.entity.home.BestoneTypeBean;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.List;

public class ClassAdapter extends CommonAdapter<BestoneTypeBean> {
    private Context context;

    public ClassAdapter(Context context, List<BestoneTypeBean> datas) {
        super(context, R.layout.home_bestone_classtype, datas);
        this.context = context;
    }

    @Override
    protected void convert(ViewHolder viewHolder, BestoneTypeBean bean, int positon) {
        viewHolder.setText(R.id.classtypeText, bean.getTypeName());
        ImageView img = viewHolder.getView(R.id.classtypeImg);
        Glide.with(context).load(bean.getTypeImage()).into(img);
    }
}
